package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.Favorite;
import com.rockcent.mall.lib.domain.enumclass.FavoriteType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zhangjh 2016/10/21.
 */
@Repository
public interface FavoriteRepository extends JpaRepository<Favorite, Long>, JpaSpecificationExecutor,FavoriteRepositoryCustom {
    Favorite findByCustomerIdAndMerchantIdAndType(Long id, Long targetId, FavoriteType merchant);

    Favorite findByCustomerIdAndProductIdAndType(Long id, Long targetId, FavoriteType product);
}
